package July;


import java.util.Scanner;

public class Day0714 {
    //连续最大和
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        //接收处理
        int n = scanner.nextInt();
        int[] nums = new int[n+1];
        for (int i = 0; i < n; i++) {
            nums[i] = scanner.nextInt();
        }

        int maxNums = nums[0];
        int num = nums[0];

        for (int i = 1; i < n; i++) {
            num = Math.max(num+nums[i],nums[i]);
            if (num>maxNums)
                maxNums = num;
        }
        System.out.println(maxNums);
    }
    
    
    //统计回文
    public static void main(String[] args) {
        //处理接收数据
        Scanner scanner = new Scanner(System.in);
        String a = scanner.next();
        String b = scanner.next();
        
        int count = 0;
        int len = a.length();
        for (int i = 0; i <= len; i++) {
            String str = a.substring(0,i)+b+a.substring(i,len);
            if (huiWen(str))
                count++;
        }
        System.out.println(count);
    }

    private static boolean huiWen(String str) {
        int i = 0;
        int j = str.length()-1;
        while (i<j){
            if (str.charAt(i) != str.charAt(j))
                return false;
            j--;
            i++;
        }
        return true;
    }
}
